package org.budo.dubbo.serialize.fastjson;

import java.io.IOException;
import java.io.InputStream;

import com.alibaba.dubbo.common.serialize.support.json.FastJsonObjectInput;
import com.alibaba.fastjson.JSON;

/**
 * @author limingwei
 */
public class BudoFastJsonObjectInput extends FastJsonObjectInput {
    private InputStream inputStream;

    public BudoFastJsonObjectInput(InputStream inputStream) {
        super(inputStream);
        this.inputStream = inputStream;
    }

    @Override
    public <T> T readObject(Class<T> cls) throws IOException, ClassNotFoundException {
        return JSON.parseObject(this.inputStream, cls);
    }
}